package com.qzsoft.zhjd.common.model;

/**
 * 马歇尔稳定度试验仪数据对象
 * 包含试验实时数据和试验最终结果的所有字段
 */
public class MarshallDataYjkj {
    private int instrumentCode;      // 仪器代码
    private int dataType;           // 数据类型标识：0xA4-试验数据，0xA7-结果数据
    private Integer flag;           // 数据标志：0-无效数据，1-试验数据（仅试验数据有效）
    private Double stability;       // 稳定度值，单位kN
    private Double flow;            // 流值，单位mm
    private boolean valid;          // 数据是否有效（校验和验证结果）

    // 构造方法
    public MarshallDataYjkj() {}

    public MarshallDataYjkj(int instrumentCode, int dataType, Integer flag,
            Double stability, Double flow, boolean valid) {
        this.instrumentCode = instrumentCode;
        this.dataType = dataType;
        this.flag = flag;
        this.stability = stability;
        this.flow = flow;
        this.valid = valid;
    }

    // Getter和Setter方法
    public int getInstrumentCode() { return instrumentCode; }
    public void setInstrumentCode(int instrumentCode) { this.instrumentCode = instrumentCode; }

    public int getDataType() { return dataType; }
    public void setDataType(int dataType) { this.dataType = dataType; }

    public Integer getFlag() { return flag; }
    public void setFlag(Integer flag) { this.flag = flag; }

    public Double getStability() { return stability; }
    public void setStability(Double stability) { this.stability = stability; }

    public Double getFlow() { return flow; }
    public void setFlow(Double flow) { this.flow = flow; }

    public boolean isValid() { return valid; }
    public void setValid(boolean valid) { this.valid = valid; }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("MarshallData{");
        sb.append("instrumentCode=0x").append(String.format("%02X", instrumentCode));
        sb.append(", dataType=0x").append(String.format("%02X", dataType));
        sb.append(", flag=").append(flag);
        sb.append(", stability=").append(stability).append("kN");
        sb.append(", flow=").append(flow).append("mm");
        sb.append(", valid=").append(valid);
        sb.append('}');
        return sb.toString();
    }
}
